//
//  SecureTools.h
//  leda
//
//  Created by cuibo on 16/4/3.
//  Copyright © 2016年 cuibo. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface ZCSecureTools : NSObject

//md5 32位 加密 （小写）
+ (NSString *)md5:(NSString *)str;

//rsa加密
//+ (NSString *)rsa:(NSString *)str;
//+ (NSString *)deRsa:(NSString *)str;

//sha256
+ (NSString *)sha256:(NSString *)str;

#pragma mark - AES

//AES加密,AES/ECB/PKCS5Padding 1.
//解密
+(NSString *)AES128Decrypt:(NSString *)encryptText key:(NSString *)key;
/**
 三一用这个下边的四个。加密方式ECB

 @param message 1
 @param password 1
 @return 11
 */
+ (NSString *)encrypt:(NSString *)message password:(NSString *)password;
+ (NSString *)decrypt:(NSString *)base64EncodedString password:(NSString *)password;

//AES加密,AES/ECB/PKCS5Padding 2.
- (NSData *)encryptText:(NSString*)text key:(NSString *)key;
- (NSString *)decryptText:(NSData*)data key:(NSString *)key;

//AES加密,AES/CBC
+(NSString*)encryptAESData:(NSString*)string app_key:(NSString*)key;
+(NSString*)decryptAESData:(NSString *)string  app_key:(NSString*)key;

#pragma mark - base64
+ (NSString*)encodeBase64String:(NSString *)input;
+ (NSString*)decodeBase64String:(NSString *)input;

+ (NSString*)encodeBase64Data:(NSData *)data;
+ (NSString*)decodeBase64Data:(NSData *)data;

@end
